# coding=utf-8
"""
author:董新强
createdate: 2024/3/1 17:35
description: 
"""
import  requests
if __name__ == '__main__':
    url = 'http://127.0.0.1:8888/'
    script="""log("start script")
use_tool("default")
use_wobj("default")
set_joints_speed(45,20) -- 设置关节速率为45%
set_tail_speed(50,20) -- 设置速度为50mm/s
wait(1)

movej({30,30,30,0,0,0}) -- debug
curpos = get_tcp()
curpos[6]=curpos[6]+0.2
movep(curpos) -- debug 

curpos = get_tcp()
curpos[6]=curpos[6]-0.2
movel(curpos) -- debug

n=0
while (n<3) do
	movej_d({0.1,0.1,0.1,0,0,0}) -- debug
	n=n+1
end
movep_d({0,0,0,0,0,0.1})
movel_d({0,0,0,0,0,-0.1})

curjs = get_joints()
print(curjs)
tool(2,1) -- 工具执行动作
exit()
------ 函数结束-----------------
"""

    x = requests.post(url,data=" "+script)
